package RLK_MICRO;


import javax.microedition.io.Connector;
import javax.microedition.io.ContentConnection;
import java.io.IOException;
import java.io.InputStream;


public class Example_01 {
    private byte[] EMPTY;

    public byte[] getData(final String url) throws IOException {
        ContentConnection connection = (ContentConnection) Connector.open(url); // Resource allocated
        InputStream iStrm = connection.openInputStream();
        int length = (int) connection.getLength();
        if (length > 0) {
            byte data[] = new byte[length];
            iStrm.read(data);
            return data;
        }
        return EMPTY;
    }
}
